package com.ideaaedi.commonds.security;

import lombok.experimental.UtilityClass;

import javax.annotation.concurrent.ThreadSafe;

/**
 * (non-javadoc)
 *
 * @author <font size = "20" color = "#3CAA3C"><a href="https://gitee.com/JustryDeng">JustryDeng</a></font> <img src="https://gitee.com/JustryDeng/shared-files/raw/master/JustryDeng/avatar.jpg" />
 * @since 1.0.0
 */
@ThreadSafe
@UtilityClass
public class Base64 {
    
    /**
     * base64#encode
     */
    public static String encode(byte[] bytes) {
        return java.util.Base64.getEncoder().encodeToString(bytes);
    }
    
    /**
     * base64#decode
     */
    public static byte[] decode(String str) {
        return java.util.Base64.getDecoder().decode(str);
    }
    
}
